import 'package:flutter/material.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBEngineer/YBBaseRouter/YBNavigator.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBHelper/YBColor/YBColor.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBHelper/YBTextStyle/YBTextStyle.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBModule/YBHomePage/YBMapMiShuPage/YBMapMiShuProvider/YBMapMiShuEventBus.dart';


class YBMiaoShuInfoPage extends StatelessWidget {

  TextEditingController _miaoShuEditeController = TextEditingController();

  @override
  Widget build(BuildContext context) {
    return Container(
      child: Scaffold(
        appBar: AppBar(
          elevation: 0,
          title: Text(
            '需求描述',
          ),
        ),
        body: Column(
          mainAxisAlignment: MainAxisAlignment.start,
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            Expanded(
              child: SingleChildScrollView(
                child: Padding(
                  padding: EdgeInsets.only(left: 20,right: 20,top: 24),
                  child: Column(
                    mainAxisAlignment: MainAxisAlignment.start,
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: [
                      Container(
                        child: Text(
                          '需求描述',
                          style:YBTextStyle.TextStyle18181818Medium,
                        ),
                      ),
                      Container(
                        height: 24,
                      ),
                      Container(
                        child: TextField(
                          decoration: InputDecoration(
                            hintText:'请尽量详细描述您的办事需求，可以减少并提高接单率',
                            fillColor: YBColor.colorF5F5F5,
                            filled: true,
                            border: InputBorder.none,
                          ),
                          maxLength: 200,
                          maxLines: 10,
                        ),
                      ),
                    ],
                  ),
                ),
              ),
            ),
            Container(
              height: 60,
              child: Padding(
                padding: EdgeInsets.only(left: 20,right: 20),
                child: Row(
                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                  crossAxisAlignment: CrossAxisAlignment.center,
                  children: [
                    Expanded(
                      flex: 1,
                      child: Container(
                        height: 44,
                        child: OutlineButton(
                          shape: RoundedRectangleBorder(
                            borderRadius: BorderRadius.all(Radius.circular(8.0)),

                          ),
                          child: Text('清空',style: YBTextStyle.TextStyle64646416,),
                          onPressed: () async {
                            _miaoShuEditeController.text = "";
                          },
                        ),
                      ),
                    ),
                    Container(
                      width: 20,
                    ),
                    Expanded(
                      flex: 2,
                      child: Container(
                        height: 44,
                        child: RawMaterialButton(
                          shape: RoundedRectangleBorder(
                            borderRadius: BorderRadius.all(Radius.circular(4.0)),
                          ),
                          fillColor: YBColor.commonThemeColor,
                          child: Text('选好了',style: YBTextStyle.TextStyleFFFFFF16Medium,),
                          onPressed: () async {
                            eventBus.fire(YBMapMiShuMiaoShuEventBus(_miaoShuEditeController.text));
                            YBNavigatorUtil.goBack(context);
                          },
                        ),
                      ),
                    ),
                  ],
                ),
              ),
            ),
          ],
        ),
      ),
    );
  }
}
